In digital image processing, a smoothed image with a blurred image is generated by using a low pass filter, and an average value of level values of pixels in a filter size is used as a signal level of a pixel of interest. However, when the low pass filter is used, because the average value of the level values of the pixels in the filter size is used as the level value of the pixel of interest, a problem occurs in that an edge portion having a large difference in level values is also blurred. More specifically, when the low pass filter is used, as depicted in FIG. 17, a gradient of an edge portion of an image to be processed having a large contrast depicted by a solid line, is smoothed in a low pass filter image (LPF image in the diagram) output from the low pass filter depicted by a dotted line. Accordingly, the edge portion cannot be maintained.
To improve such a problem, various technologies have been developed to accurately maintain the edge portion of an image and to blur the portion other than the edge. For example, Japanese Laid-open Patent Publication No. 2000-105815 discloses a technology that relates to a face image processing device (image processing device) using an epsilon filter.
More specifically, as depicted in FIG. 18, a pixel positioned at coordinates (m, n) of an image is regarded as a pixel of interest, and pixels at the periphery of the pixel of interest (in this case, eight pixels at coordinates (m−1, n−1), coordinates (m, n−1), coordinates (m+1, n−1), coordinates (m−1, n), coordinates (m+1, n), coordinates (m−1, n+1), coordinates (m, n+1), and coordinates (m+1, n+1)) are regarded as peripheral pixels. A differential detector 500 calculates the difference between a level value of the pixel of interest (such as a gray scale value of a luminance signal) and a level value of each peripheral pixel, and a threshold determining unit 501 extracts a peripheral pixel whose difference calculated by the differential detector 500 is smaller than a predetermined threshold TH. An adder 503 then adds a pixel value of the pixel of interest with a pixel value obtained by multiplying a predetermined coefficient to a signal level of the peripheral pixel extracted by the threshold determining unit 501, and outputs the resultant value as a pixel value of the pixel of interest.
In this manner, in the conventional technology disclosed in Japanese Laid-open Patent Publication No. 2000-105815, the level width of the gray scale value is limited, by simply processing the peripheral pixels whose difference with the level value of the pixel of interest is smaller than the threshold TH. Accordingly, as depicted in FIG. 19, the gradient of the edge portion of an epsilon filter image (ε filter image in the diagram) output from the epsilon filter depicted by the dotted line is not smoothed, but maintaining the gradient of the edge portion of the image to be processed depicted by the solid line. Thus, the edge portion is accurately maintained and the portion other the edge is blurred.
However, in the conventional technology using the epsilon filter disclosed in Japanese Laid-open Patent Publication No. 2000-105815, each pixel in the image is used as a pixel of interest, and the difference between the level value of the pixel of interest and the level value of each peripheral pixel need to be calculated and compared with the threshold. Accordingly, a conditional branch process using variables is to be included, thereby creating problems such as a heavy processing load and difficulty in increasing speed.
To reduce the processing load and to increase the speed, a smoothing process using an epsilon filter may be performed on a reduced image (the number of pixel of interest and peripheral pixels is reduced by taking out pixels in the image), and the image to which the smoothing process is performed may then be enlarged. In other words, the speed can be increased by carrying out the process by lowering the resolution of (discretizing) an image. However, when the image is reduced, depending on the position of the edge, the pixels at the edge portion may be taken out, thereby generating a reduced image not including edge information. Accordingly, in the conventional technology using the epsilon filter disclosed in Japanese Laid-open Patent Publication No. 2000-105815, in which a pixel value of the pixel of interest is obtained by adding the pixel value of the pixel of interest with the pixel values of the peripheral pixels to be processed, as depicted in FIG. 20, the gradient at the edge portion of the image to be processed depicted by the solid line may not be maintained by the output from the epsilon filter, generated by a discrete process depicted by the dotted line. In other words, in the conventional technology using the epsilon filter disclosed in Japanese Laid-open Patent Publication No. 2000-105815, when the resolution of the image is lowered to reduce the processing load and to increase the speed thereof, a problem occurs in that the edge portion cannot be accurately maintained.
To reduce the processing load and to increase the speed thereof, there is a method (sequential process) that breaks a two-dimensional filter into a one-dimensional filter used to process an image in the horizontal direction and a one-dimensional filter used to process the image in the vertical direction, and carries out the smoothing process in the vertical direction, after carrying out the smoothing process in the horizontal direction. However, when the sequential process is applied to the convention technology using the epsilon filter disclosed in Japanese Laid-open Patent Publication No. 2000-105815, the one-dimensional filter in the vertical direction (vertical filter) is applied to an output image of the one-dimensional filter in the horizontal direction (horizontal filter). Accordingly, a vertical outline may be generated.
With reference to FIG. 21, the generation of the vertical outline will be described. In an input image 600, the difference between a level value (gray scale value) of each pixel positioned in a region 602 and a gray scale value of each pixel positioned in a region 603 is large, the difference between a level value (gray scale value) of each pixel positioned in a region 601 and a gray scale value of each pixel positioned in the region 602 adjacent to the region 601 is equal to or more than the limited level width (equal to or more than threshold TH), and the difference between the gray scale value of each pixel positioned in the region 601 and the gray scale value of each pixel positioned in the region 603 adjacent to and below the region 601 in the vertical direction is less than the limited level width.
When the one-dimensional filter used for processing in the horizontal direction is applied to the input image 600, the difference between the gray scale value of each pixel positioned in the region 601 and the gray scale value of each pixel positioned in the region 602 becomes equal to or more than the threshold TH. Accordingly, when a pixel positioned in the region 601 is used as a pixel of interest, the pixels positioned in the region 602 will not be processed. When a pixel positioned in the region 602 is used as a pixel of interest, the pixels positioned in the region 601 will not be processed. Therefore, in a horizontal filter output image 600a in which a horizontal filter is applied to the input image 600, a region 601a that corresponds to the region 601 in the input image 600 and a region 602a that corresponds to the region 602 in the input image 600 are not blurred.
Next, a vertical filter is applied to the horizontal filter output image 600a. The difference between a gray scale value of each pixel positioned in the region 601 and a gray scale value of each pixel positioned in the region 603 of the input image 600 is less than the threshold TH. Accordingly, the difference between a gray scale value of each pixel positioned in the region 601a of the horizontal filter output image 600a that corresponds to the region 601 of the input image 600, and a gray scale value of each pixel positioned in the region 603a of the horizontal filter output image 600a that corresponds to the region 603 of the input image 600 also becomes less than the threshold TH. Therefore, when a pixel in the region 601a of the horizontal filter output image 600a is used as a pixel of interest, the pixels positioned in the region 603a are to be processed. When a pixel in the region 603a of the horizontal filter output image 600a is used as a pixel of interest, the pixels positioned in the region 601a are to be processed. Accordingly, a vertical filter output image 600b in which a vertical filter is applied to the horizontal filter output image 600a is blurred in the vertical direction (regions 601b and 603b that correspond to the regions 601 and 603 of the input image 600). However, a vertical outline is generated at a boundary between the regions 601b and 602a that correspond to the regions 601 and 602 of the input image 600, where the horizontal filter could not blur.
In this manner, in the conventional technology using the epsilon filter disclosed in Japanese Laid-open Patent Publication No. 2000-105815, when the processing load is reduced and the speed is increased by lowering the resolution of the image and by performing sequential process, a problem occurs in that the edge cannot be maintained accurately.